import store from "@/store";
import request from "./axios-request"; // 从axios-request.js内引入axiosService
// let url12 = 'http://192.168.29.175:8888/';
let url12 = 'http://qqm.longwan.gov.cn:8888/'


export const Login = data => {
  return request({
    url: url12 + "login", // 根据实际接口地址来写
    method: "post",
    data
  });
};
// 验证码
export const yzm = params =>{
  return request({
    url:url12+ 'captchaImage',
    params
  })
}
// 获取用户信息
export const getInfo  = params =>{
  return request({
    url: url12+'getInfo',
    params
  })
}
// 获取公告列表
export const noticeList  = params =>{
  return request({
    url:url12+'system/notice/list',
    params
  })
}
//根据id获取公告信息
export const getnotice =params =>{
  return request({
    url:url12 +'system/notice/'+ params
  })
}
// 新增公告
export const addnotice = data =>{
  return request({
    url:url12 +'system/notice',
    method:'post',
    data
  })
}
// 编辑公告
export const Editnotice = data =>{
  return request({
    url:url12 + 'system/notice',
    method:'put',
    data
  })
}


//删除公告
export const removenotice = params =>{
  return request({
    url:url12 +'system/notice/' + params,
    method:'delete',
  })
}
// 课题列表
export const getPoticlist = params =>{
  return request({
    url: url12 + 'business/topic/list',
    params
  })
}
// 新增课题
export const topicAdd = data =>{
  return request({
    url: url12 + 'business/topic/add',
    method:'post',
    data
  })
}
// 文件上传
export const upload = data =>{
  return request({
    url: url12 + 'system/upload',
    method:'post',
    data
  })
}
// 新增用户
export const newUser = data =>{
  return request({
    url:url12 + 'system/user',
    method:'post',
    data
  })
}
// 用户信息 获取用户列表
export const UserList = params =>{
  return request({
    url:url12 + 'system/user/list',
    params
  })
}
// 删除课题
export const deleteNotic = params =>{
  return request({
    url:url12 +'business/topic/remove/' + params,
    method:'delete'
  })
}
// 审核状态
export const ChangeState = params =>{
  return request({
    url:url12+'business/topic/changeStatus',
    method:'put',
    params
  })
}
// 查询二级机构维护人员
export const maintainList = params =>{
  return request({
    url:url12+'business/topic/maintain/list',
    params
  })
}
// 新增二级机构维护人员
export const addMaintain = data =>{
  return request({
    url:url12+'business/topic/maintain',
    method:'post',
    data
  })
}
// 分配配额
export const TopicQuota = data =>{
  return request ({
    url:url12+'business/topic/quota',
    method:'post',
    data
  })
}
//获取部门列表
export const deptList = params =>{
  return request({
    url:url12 +'system/dept/list',
    params
  })
}
// 查询子课题列表
export const topicSonList = params =>{
  return request({
    url:url12 +'business/topic/son/list',
    params
  })
}
